package com.erdos.upc.entity;

import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.erdos.common.entity.AbstractEntity;


public class Role extends AbstractEntity {
   
    private String name;

    private String description;
    
    private List<Privilege> privileges;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

	public List<Privilege> getPrivileges() {
		return privileges;
	}

	public void setPrivileges(List<Privilege> privileges) {
		this.privileges = privileges;
	}
	/**
	 * equals方法复写
	 */
	public boolean equals(Object o) {
		if (!(o instanceof Role)) {
			return false;
		}
		Role role = (Role) o;
		return new EqualsBuilder().append(this.getSid(), role.getSid()).isEquals();
	}

	/**
	 * hashCode方法复写
	 */
	public int hashCode() {
		return new HashCodeBuilder(61, 15).append(this.getSid()).toHashCode();
	}
}